<br>
<br>
<?php echo $this->Ajax->link('Adicionar Empresa', array('controller' => 'companies', 'action' => 'add'), array( 'update' => 'content','class'=>'acciones')); ?>
<br>
<br>
<h1>
    <center>

        <b>INFORMACION GENERAL DE LA EMPRESA COMUNITARIA</b>

    </center>
</h1>
 <?php
    echo $this->Paginator->counter(array(
        'format' => 'Página %page% de %pages%, Mostrando %current% registros de %count% totales, empezando en %start%, terminando en %end%'
            )
    );
    ?>


<div class="paging">
    <?php
    echo $this->Paginator->options(array('update' => '#content', 'evalScripts' => false));
    echo $this->Paginator->prev('< ' .'Anterior', array(), null, array('class' => 'prev disabled'));
    echo $this->Paginator->numbers(array('separator' => ''));
    echo $this->Paginator->next(__('Siguiente') . ' >', array(), null, array('class' => 'next disabled'));
    ?>
</div>
<table border=3 cellspacing=0 cellpadding=3  class="table">
    <thead>

        <tr>

            <th><?php echo $this->Paginator->sort('Comapny.razon_social', 'Razón social'); ?></th>
            <th><?php echo $this->Paginator->sort('Comapny.representante_legal', 'Representante legal'); ?></th>
            <th><?php echo $this->Paginator->sort('Comapny.nit', 'Nit'); ?></th>
            <th><?php echo $this->Paginator->sort('departament.nombre', 'Departamento'); ?></th>
            <th><?php echo $this->Paginator->sort('City.nombre', 'Municipio'); ?></th>
            <th><?php echo $this->Ajax->link('Ver todas', array('controller' => 'companies', 'action' => 'index'), array( 'update' => 'content','class'=>'acciones')); ?></th>
            <th colspan="4">

    <form  style="background: transparent;">
        <table border="0" cellspacing="0" cellpaddding="0" >
            <tr>
                <td ><input type="text"  name="data[Company][busqueda]" style="width: 130px" ></td>
                <td ><?php echo $this->Ajax->submit('Buscar', array('url' => array('controller' => 'companies', 'action' => 'index'), 'update' => 'content', 'indicator' => 'loading')); ?></td>
            </tr>
        </table>
    </form>
    

</th>
</tr>


</thead>

<tbody>
    <?php foreach ($companies as $company): ?>
    <tr style="border: solid 1px; border-color: #327E04 " >
            <td><?php echo $company['Company']['razon_social'] ?></td>
            <td><?php echo $company['Company']['representante_legal'] ?></td>
            <td><?php echo $company['Company']['nit'] ?></td>
            <td><?php echo $company['Departament']['nombre'] ?></td>
            <td><?php echo $company['City']['nombre'] ?></td>
            <td style="font-size: small;color: forestgreen"><?php echo $this->Ajax->link('Ver_encuesta', array('action' => 'edit_poll', $company['Company']['id']), array('update' => 'content','class'=>'acciones')) ?></td>
            <td style="font-size: small;color: forestgreen"><?php echo $this->Ajax->link('Ecuesta_socios', array('controller' => 'partners', 'action' => 'index', $company['Company']['id']), array('class'=>'acciones','update' => 'content')) ?></td>
            <td style="font-size: small;color: forestgreen"><?php echo $this->Html->link('Eliminar', array('action' => 'delete', $company['Company']['id']), array('class'=>'acciones'), 'Esta seguro que desea ELIMINAR?') ?></td>
        </tr>
    <?php endforeach; ?>
</tbody>

</table>
<br>
<br>
<?php echo $this->Js->writeBuffer(); ?>
<?php echo $this->Ajax->link('Adicionar Empresa', array('controller' => 'companies', 'action' => 'add'), array( 'update' => 'content','class'=>'acciones')); ?>
